package facilius.controller.actionmanager;

import facilius.controller.ActionManager;
import facilius.controller.action.usuariocursoturma.UsuarioCursoTurmaCreateAction;
import facilius.controller.action.usuariocursoturma.UsuarioCursoTurmaDeleteAction;
import facilius.controller.action.usuariocursoturma.UsuarioCursoTurmaReadAction;
import facilius.controller.action.usuariocursoturma.UsuarioCursoTurmaShowFormAction;
import org.mentawai.authorization.Permission;
import org.mentawai.core.ActionConfig;
import org.mentawai.core.ApplicationManager;
import org.mentawai.core.Forward;
import org.mentawai.core.Redirect;
import org.mentawai.filter.AuthorizationFilter;

/**
 *
 * @author Graciano
 */
public class UsuarioCursoTurmaActionManager implements ActionManager{

    public void loadActions(ApplicationManager appManager) {
        ActionConfig ac = null;
        ac = new ActionConfig("UsuarioCursoTurmaShowForm", UsuarioCursoTurmaShowFormAction.class);
        ac.addConsequence(ApplicationManager.SUCCESS,  new Forward("jsp/usuarioCursoTurma/usuarioCursoTurmaForm.page"));
        ac.addConsequence(ApplicationManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCursoTurma")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("UsuarioCursoTurmaRead", UsuarioCursoTurmaReadAction.class);
        ac.addConsequence(ApplicationManager.SUCCESS, new Forward("jsp/usuarioCursoTurma/usuarioCursoTurmaList.page"));
        ac.addConsequence(ApplicationManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCursoTurma")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("UsuarioCursoTurmaCreate", UsuarioCursoTurmaCreateAction.class);
        ac.addConsequence(ApplicationManager.SUCCESS, new Redirect("UsuarioCursoTurmaRead.mtw"));
        ac.addConsequence(ApplicationManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCursoTurma")));
        appManager.addActionConfig(ac);

        ac = new ActionConfig("UsuarioCursoTurmaDelete", UsuarioCursoTurmaDeleteAction.class);
        ac.addConsequence(ApplicationManager.SUCCESS, new Redirect("UsuarioCursoTurmaRead.mtw"));
        ac.addConsequence(ApplicationManager.ERROR, new Forward("jsp/erro.page"));
        ac.addFilter(new AuthorizationFilter(new Permission("usuarioCursoTurma")));
        appManager.addActionConfig(ac);
    }

}
